package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysYongyouCgfpMapper;
import com.ruoyi.system.domain.SysYongyouCgfp;
import com.ruoyi.system.service.ISysYongyouCgfpService;

/**
 * 采购发票Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-18
 */
@Service
public class SysYongyouCgfpServiceImpl implements ISysYongyouCgfpService 
{
    @Autowired
    private SysYongyouCgfpMapper sysYongyouCgfpMapper;

    /**
     * 查询采购发票
     * 
     * @param vouchdate 采购发票主键
     * @return 采购发票
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysYongyouCgfp selectSysYongyouCgfpByVouchdate(String vouchdate)
    {
        return sysYongyouCgfpMapper.selectSysYongyouCgfpByVouchdate(vouchdate);
    }

    /**
     * 查询采购发票列表
     * 
     * @param sysYongyouCgfp 采购发票
     * @return 采购发票
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouCgfp> selectSysYongyouCgfpList(SysYongyouCgfp sysYongyouCgfp)
    {
        return sysYongyouCgfpMapper.selectSysYongyouCgfpList(sysYongyouCgfp);
    }

    /**
     * 新增采购发票
     * 
     * @param sysYongyouCgfp 采购发票
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysYongyouCgfp(SysYongyouCgfp sysYongyouCgfp)
    {
        return sysYongyouCgfpMapper.insertSysYongyouCgfp(sysYongyouCgfp);
    }

    /**
     * 修改采购发票
     * 
     * @param sysYongyouCgfp 采购发票
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysYongyouCgfp(SysYongyouCgfp sysYongyouCgfp)
    {
        return sysYongyouCgfpMapper.updateSysYongyouCgfp(sysYongyouCgfp);
    }

    /**
     * 批量删除采购发票
     * 
     * @param vouchdates 需要删除的采购发票主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouCgfpByVouchdates(String[] vouchdates)
    {
        return sysYongyouCgfpMapper.deleteSysYongyouCgfpByVouchdates(vouchdates);
    }

    /**
     * 删除采购发票信息
     * 
     * @param vouchdate 采购发票主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouCgfpByVouchdate(String vouchdate)
    {
        return sysYongyouCgfpMapper.deleteSysYongyouCgfpByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCgfpByDateRange(String startDate)
    {
        return sysYongyouCgfpMapper.deleteYongyouCgfpByDateRange(startDate);
    }
}
